package GUI;

import java.awt.Color;

import Controllers.AddLivArTabController;
import Controllers.LoginController;

import javax.swing.JLabel;
import javax.swing.JButton;

import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.JTextField;

/**
 * The Class AddLivArTabGUI.
 */
public class AddLivArTabGUI extends AbstractPanelGUI{
	
	/** The btn add to table. */
	private JButton btnAddToTable;
	
	/** The txt new. */
	private JTextField txtNew;
	
	/** The btn back. */
	private JButton btnBack;
	
	/**
	 * Instantiates a new adds the liv ar tab gui.
	 */
	public AddLivArTabGUI() {
		LoginController.mainWindow.setTitle("Add living area");
		setBackground(Color.ORANGE);
		initialize();
	}

	/* (non-Javadoc)
	 * @see GUI.AbstractPanelGUI#initialize()
	 */
	@Override
	public void initialize() {
		setLayout(null);
		setSize(Width,Height);
		
		btnAddToTable = new JButton("Add to Table");
		btnAddToTable.setBounds(137, 296, 200, 38);
		add(btnAddToTable);
		
		JLabel lblEnterNewLiving = new JLabel("Enter new living area");
		lblEnterNewLiving.setFont(new Font("Tahoma", Font.PLAIN, 23));
		lblEnterNewLiving.setBounds(116, 58, 311, 38);
		add(lblEnterNewLiving);
		
		txtNew = new JTextField();
		txtNew.setFont(new Font("Tahoma", Font.PLAIN, 17));
		txtNew.setBounds(137, 162, 200, 50);
		add(txtNew);
		txtNew.setColumns(10);
	
		btnBack = new JButton("Back");
		btnBack.setBounds(10, 337, 89, 23);
		add(btnBack);
		
	}
	
	/**
	 * Gets the id field.
	 *
	 * @return the id field in string
	 */
	public String getNewArea()
	{
		return txtNew.getText();
	}
	
	/**
	 * Adds action listener to add button.
	 *
	 * @param listener the listener
	 */
	public void addATTButtonActionListener(ActionListener listener)
	{
		btnAddToTable.addActionListener(listener);
	}
	
	/**
	 * Adds action listener to back button.
	 *
	 * @param listener the listener
	 */
	public void addBackButtonActionListener(ActionListener listener)
	{
		btnBack.addActionListener(listener);
	}
}
